import { ref,reactive,computed } from 'vue'
import { defineStore } from 'pinia'

export const useUsernameStore = defineStore('username', () => {
    // state
    const username = reactive({
      firstname: '李',
      lastname:'四'
    })

    // getter
    const firstAndLastName = computed(() => username.firstname + '-' + username.lastname)
    const lastAndFirstName = computed(() => firstAndLastName)

    // action

  
    return { username ,firstAndLastName,lastAndFirstName }
  })